const state = {
    // 自己创建的钱包
    round: {
        id: "",
        num1: "",
        num2: "",
        num3: "",
        lastTime: "",
    },
    cpt: {
        id: "",
        explainShow: false
    }
};

const actions = {
    aRound({commit}, {id = '', num1 = '', num2 = '', num3 = '', lastTime = ''}) {
        commit('mRound', {id, num1, num2, num3, lastTime})
    },
    aCpt({commit}, {id = '', explainShow = ""}) {
        commit('mCpt', {id, explainShow})
    },
};

const mutations = {
    mRound(state,  {id, num1, num2, num3, lastTime}) {
        id === '' && (id = state.round.id);
        num1 === '' && (num1 = state.round.num1);
        num2 === '' && (num2 = state.round.num2);
        num3 === '' && (num3 = state.round.num3);
        lastTime === '' && (lastTime = state.round.lastTime);

        state.round =  {id, num1, num2, num3, lastTime};
    },
    mCpt(state,  {id, explainShow}) {
        id === '' && (id = state.cpt.id);
        explainShow === '' && (explainShow = state.cpt.explainShow);

        state.cpt =  {id, explainShow};
    },
};

export default {
    namespaced: true,
    state,
    actions,
    mutations,
}